var customers;

$(function(){

	init_page();

	customers = new Customers();

});

function Customers(){

	var me = this;
	
	this.Edit = function(customer, cbFunc){
		var pack = '<req obj="customer" act="edit">'+ customer.toXml() +'</req>';
		var req = new Req();
		req.Post(pack, cbFunc);
	}

}

function Customer(){
	var me = this;

	this.ID = 0;
	this.Title = "";
	this.Contacts = "";
	this.Addr = "";

	this.toXml = function(){
		return '<customer id="'+ me.ID +'" title="'+ this.Title +'" contacts="'+ this.Contacts +'" addr="'+ this.Addr +'"/>';
	}

}

function init_page(){
	var tab = $( "#tab-customers" );

	$("tr td.edit", tab).editable();
}